<?php
namespace ServicesApi\Response;

use ServicesApi\Response\Dto\GoodsItemsDtoResponse;

class GoodsResponse{
    public $page;
    public $page_size;
    public $data;

    /**
     * @return mixed
     */
    public function getPage()
    {
        return (int)$this->page;
    }

    /**
     * @param mixed $page
     */
    public function setPage($page)
    {
        $this->page = (int)$page;
    }

    /**
     * @return mixed
     */
    public function getPageSize()
    {
        return (int)$this->page_size;
    }

    /**
     * @param mixed $page_size
     */
    public function setPageSize($page_size)
    {
        $this->page_size = (int)$page_size;
    }

    /**
     * @return mixed
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * @param mixed $data
     */
    public function setData($goodsItems,$user_id=0)
    {
        foreach ($goodsItems as $key=>$value){
            $goodsItemsDtoResponse = new GoodsItemsDtoResponse();
            $goodsItemsDtoResponse->setGoodsId($value['GoodsId']);
            $goodsItemsDtoResponse->setTitle($value['Title']);
            $goodsItemsDtoResponse->setShortTitle($value['ShortTitle']);
            $goodsItemsDtoResponse->setShopType($value['ShopType']);
            $goodsItemsDtoResponse->setPicLogo($value['PicLogo']);
            $goodsItemsDtoResponse->setCouponurl($value['Couponurl']);
            $goodsItemsDtoResponse->setCouponMoney($value['CouponMoney']);
            $goodsItemsDtoResponse->setCouponSurplus($value['CouponSurplus']);
            $goodsItemsDtoResponse->setPrice($value['Price']);
            $goodsItemsDtoResponse->setEndPrice($value['EndPrice']);
            $goodsItemsDtoResponse->setCommission($value['Commission']);
            $goodsItemsDtoResponse->setMonthSale($value['MonthSale']);
            $goodsItemsDtoResponse->setSite($value['Site']);
            $goodsItemsDtoResponse->setShopName($value['ShopName']);
            $this->data[] = $goodsItemsDtoResponse;
        }

    }

}